package cn.zhaozhiqi.remote.fallback;

import cn.zhaozhiqi.remote.api.IBigDataFeignClient;
import cn.zhaozhiqi.remote.dto.DriverPointDto;
import cn.zhaozhiqi.result.JSONResult;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class BigDataFeignClientFallbackFactory implements FallbackFactory<IBigDataFeignClient> {
    @Override
    public IBigDataFeignClient create(Throwable cause) {
        return new IBigDataFeignClient() {


            @Override
            public JSONResult<List<DriverPointDto>> ComputedRealMile(String orderNo) {
                return JSONResult.error("查询bigdata内位置坐标服务不可达");
            }
        };
    }
}
